Date.prototype.format = function(a) {
    var b = {
        "M+": this.getMonth() + 1,
        "d+": this.getDate(),
        "h+": this.getHours(),
        "m+": this.getMinutes(),
        "s+": this.getSeconds(),
        "q+": Math.floor((this.getMonth() + 3) / 3),
        S: this.getMilliseconds()
    };
    /(y+)/.test(a) && (a = a.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)));
    for (var c in b) RegExp("(" + c + ")").test(a) && (a = a.replace(RegExp.$1, RegExp.$1.length == 1 ? b[c] : ("00" + b[c]).substr(("" + b[c]).length)));
    return a
};
$("#jp_today,#jd_fromDate,#jd_toDate,#ht_today").each(function(a) {
    a.value = (new Date((new Date).getTime() + 864E5)).format("yyyy-MM-dd")
});
$("#skinlist a").on("click",
function(a) {
    a = parseInt(a.innerHTML) - 1;
    Cookie.set("style", a);
    skinSelector.set("style", a)
});
var MailLogin = {
    mailCache: [],
    sendMail: function() {
        var a = $("#mail_user_114la").el.value,
        b = $("#mail_passwd_114la").el.value,
        c = $("#mail_server_114la").el,
        d = document.mail,
        c = c.selectedIndex,
        e = Config.Mail[c],
        a = {
            u: a,
            p: b
        };
        if (e.val == 0) alert("\u60a8\u6ca1\u6709\u9009\u62e9\u90ae\u7bb1\uff01");
        else if (Yl.trim(a.u) == "") alert("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01"),
        $("#mail_user_114la").el.focus();
        else if (Yl.trim(a.p) == "") alert("\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01"),
        $("#mail_passwd_114la").el.focus();
        else {
            if (this.mailCache.index != c) this.mailCache.forEach(function(a) {
                d.removeChild(a)
            }),
            this.mailCache = [];
            d.action = e.action;
            for (I in e.params) $(d).create("input", {
                type: "hidden",
                name: I,
                value: format(e.params[I], a),
            },
            function(a) {
                MailLogin.mailCache.push(a);
                this.append(a)
            });
            d.submit();
            $("#mail_passwd_114la").el.value = ""
        }
    },
    change: function(a) {
        var b = Config.Mail[a.selectedIndex];
        b.type == "link" ? (window.open(b.action), a.selectedIndex = 17) : cache.set("SE_ONFOCUS", !0)
    }
},
SE = function() {
    //var a = [$("#searchForm").el.tn, $("#searchForm").el.ch];
   
    
} ();
document.onclick = function(a) {
    var a = a || window.event,
    a = a.srcElement || a.target,
    b = a.id;
    b !== "showSetting" && $("#settingBox").el && $("#settingBox").hide();
    if (a.tagName && a.tagName.toUpperCase() == "A" || a.parentNode.tagName && a.parentNode.tagName.toUpperCase() == "A" || a.parentNode.parentNode.tagName && a.parentNode.parentNode.tagName.toUpperCase() == "A") {
        if (a.rel && a.rel == "nr") return;
        var c, d;
        if (a.parentNode.tagName.toUpperCase() == "A" && a.tagName.toUpperCase() == "IMG") c = a.parentNode.href,
        d = a.alt;
        else if (a.parentNode.parentNode.tagName.toUpperCase() == "A") c = a.parentNode.parentNode.href,
        d = a.innerHTML;
        else {
            c = a.href;
            d = a.innerHTML;
            if (Yl.trim(c) == "javascript:void(0);" || Yl.trim(c) == "javascript:void(0)") c = d;
            if (a.getAttribute("rel")) c = d = a.innerHTML
        }
        KeywordCount({
            u: c,
            n: d,
            q: 0
        });
        UserTrack.add(a)
    }
    Config.Track.forEach(function(a) {
        b == a[0] && KeywordCount(a[1])
    })
};
$("#showSetting").on("click",
function(a) {
    a.blur();
    $("#settingBox").el ? $("#settingBox").show() : $("#wrap").create("div", {
        id: "settingBox"
    },
    function(a) {
        var c = Yl.createFrame({
            src: "/public/widget/setting/index.html",
            width: "260",
            height: "230"
        });
        a.innerHTML = '<span class="h2">\u4e2a\u6027\u8bbe\u7f6e</span><div id="LSIMG" class="loading"></div><div id="loadSettingBox" style="display:none;">' + c + "</div>";
        this.append(a);
        var d = a.getElementsByTagName("iframe")[0];
        Yl.loadFrame(d,
        function() {
            $("#LSIMG").hide();
            a.innerHTML = '<span class="h2">\u4e2a\u6027\u8bbe\u7f6e</span>' + c;
            $("#settingBox .h2").on("click",
            function() {
                $("#settingBox").hide()
            })
        })
    })
});
(function() {
    if ($("#topsite em").el) {
        var a, b = !0,
        c, d = function() {
            if (b && a) a.style.display = "none"
        };
        $("#topsite em").each(function(e) {
            e.onmouseover = function() {
                d();
                var f = e.parentNode.getElementsByTagName("div")[0];
                c = window.setTimeout(function() {
                    $(f).show()
                },
                200);
                a = f;
                b = !1;
                if (!f.onmouseover) f.onmouseover = function() {
                    b = !1
                },
                f.onmouseout = function() {
                    b = !0;
                    window.setTimeout(d, 200)
                }
            };
            e.onmouseout = function() {
                b = !0;
                window.setTimeout(d, 200);
                c != void 0 && window.clearTimeout(c)
            }
        })
    }
})();
$("#sm_tab li").on("click",
function(a) {
    $("#sf .int").el.focus();
    $("#sm_tab li").removeClass("active");
    $(a).addClass("active");
    a = a.getAttribute("rel");
    KeywordCount({
        u: a,
        n: a,
        q: 0
    });
    cache.set("CURRENT_SE_TAB", a);
    SE.set(Config.Search[a]);
    if (Browser.isIE) $("#sf .int").el.value = $("#sf .int").el.value;
    $("#sw div").hide();
    $("div#sw_" + a).show();
    return ! 1
});
var HoverTab = function(a, b) {
    var c, d = a.getAttribute("rel");
    ["click", "mouseover"].forEach(function(e) {
        switch (e) {
        case "click":
            c && window.clearTimeout(c);
            a["on" + e] = function() {
                b();
                d && KeywordCount({
                    u: d,
                    n: d,
                    q: 0
                })
            };
            break;
        case "mouseover":
            a["on" + e] = function() {
                c && window.clearTimeout(c);
                c = window.setTimeout(function() {
                    b();
                    d && KeywordCount({
                        u: d,
                        n: d,
                        q: 0
                    })
                },
                300)
            },
            a.onmouseout = function() {
                c != void 0 && window.clearTimeout(c)
            }
        }
    })
};
$("#bm_tab li").each(function(a) {
    function b(a) {
        function c() {
            var a = document.createElement("div");
            a.id = b;
            a.innerHTML = '<iframe width="100%" height="272" frameborder="0" scrolling="no" allowtransparency="true" src="' + g + '"></iframe>';
            $("#bb .box").el.insertBefore(a, $("#bb .box").el.firstChild);
            if (k) a.className = "nocache";
            cache.set("BOARD_BOX_TAB", b, 1)
        }
        var b = a.getAttribute("rel"),
        g = a.getAttribute("url"),
        k = a.getAttribute("nocache");
        if (b && (a = cache.get("BOARD_BOX_TAB"), "#" + b != cache.get("LAST_BOXTAB"))) {
            if (cache.is("LAST_BOXTAB")) {
                var h = $(cache.get("LAST_BOXTAB"));
                if (h.el.className == "nocache") h.el.getElementsByTagName("iframe")[0].src = "";
                h.hide()
            } else $("#fm").hide();
            g ? (cache.is("BOARD_BOX_TAB") == !1 ? c() : a.indexOf(b) == -1 && c(), cache.set("LAST_BOXTAB", "#" + b), k ? ($("#" + b).show(), $("#" + b).el.getElementsByTagName("iframe")[0].src = g) : $("#" + b).show()) : ($("#" + b).show(), cache.set("LAST_BOXTAB", "#" + b))
        }
    }
    var c = a.getAttribute("rel");
    a.onclick = function() {
        cache.get("HAS_SHOW_QS") && (qucikSearch.close(!0), $("#q_int input").el.blur());
        $("#bm_tab li").removeClass("active");
        a.className = "active";
        b(a);
        c && KeywordCount({
            u: c,
            n: c,
            q: 0
        })
    }
});
var Suggest = function() {
    function a() {
        if (i) {
            var a = i.length;
            h < 0 ? h = a - 1 : h >= a && (h = 0);
            for (var c = 0, a = i.length; c < a; c++) i[c].className = "";
            i[h].className = "hover";
            f.el.value = i[h].innerHTML
        }
    }
    function b() {
        if (! (typeof m != "object" || typeof m == "undefined")) {
            var a = "<ul>";
            m.forEach(function(c, b) {
                a += cache.get("CURRENT_SE_TAB") == "taobao" ? '<li key="' + b + '">' + c[0] + "</li>": '<li key="' + b + '">' + c + "</li>"
            });
            a += '</ul><div class="close"><a id="closeSugBtn">\u5173\u95ed</a></div>';
            i = g.el.getElementsByTagName("li");
            g.el.innerHTML = a;
            g.show();
            h = -1;
            l = !1;
            d()
        }
    }
    function c() {
        g.hide();
        l = !0
    }
    function d() {
        g.el.onmouseover = function(a) {
            a = a || window.event;
            a = a.target || a.srcElement;
            if (a.tagName.toUpperCase() == "LI") {
                for (var c = 0, b = i.length; c < b; c++) i[c].className = "";
                a.className = "hover";
                h = parseInt(a.getAttribute("key"));
                $(a).on("mouseout",
                function(a) {
                    a.className = ""
                })
            }
            n = !0
        };
        g.el.onmouseout = function() {
            n = !1
        };
        g.el.onclick = function(a) {
            a = a || window.event;
            a = a.target || a.srcElement;
            if (a.tagName.toUpperCase() == "LI") {
                f.el.value = a.innerHTML;
                f.el.focus();
                c();
                var b = document.getElementById("searchForm");
                cache.set("Handdle_Key", "S");
                b.onsubmit();
                b.submit()
            }
            a.id == "closeSugBtn" && (f.el.setAttribute("autocomplete", "on"), f.el.focus(), g.hide(), o = !0)
        }
    }
    function e() {
        var a = $("head").el,
        c = cache.get("CURRENT_SE_TAB");
        if (j) j.charset = c == "taobao" ? "utf-8": "gb2312";
        Browser.isIE || (j && a.removeChild(j), j = null);
        if (!j) {
            var b = document.createElement("script");
            b.type = "text/javascript";
            b.charset = c == "taobao" ? "utf-8": "gb2312";
            a.insertBefore(b, a.firstChild);
            j = b
        }
        var a = (new Date).getTime(),
        b = encodeURIComponent(f.el.value),
        d = "http://suggestion.baidu.com/su?wd=" + b + "&sc=114la&rd=" + a;
        switch (c) {
        case "mp3":
            d = "http://nssug.baidu.com/su?wd=" + b + "&prod=mp3&sc=114la&rd=" + a;
            break;
        case "image":
            d = "http://nssug.baidu.com/su?wd=" + b + "&prod=image&fm=114la&rd=" + a;
            break;
        case "v115":
            d = "http://nssug.baidu.com/su?wd=" + b + "&prod=video&sc=114la&rd=" + a;
            break;
        case "zhidao":
            d = "http://nssug.baidu.com/su?wd=" + b + "&prod=zhidao&sc=114la&rd=" + a;
            break;
        case "web":
            d = "http://suggestion.baidu.com/su?wd=" + b + "&sc=114la&rd=" + a;
            break;
        case "taobao":
            d = "http://suggest.taobao.com/sug?code=utf-8&callback=TB.Suggest.callback&q=" + b + "&rd=" + a
        }
        j.src = d
    }
    var f = $("#sf .int"),
    g = $("#suggest"),
    k,
    h = -1,
    j = null,
    m,
    i,
    n = !1,
    l = !1,
    o = !1;
   
   
   
} (),
UserTrack = function() {
    return {
        add: function(a) {
            try {
                if (a.tagName.toUpperCase() == "A" && a.href.indexOf("http://") == 0 && a.href.indexOf("http://" + Yl.getHost()) != 0 && !(a.rel && a.rel == "nr")) {
                    var b = {
                        url: a.href,
                        content: a.innerHTML
                    },
                    c = b.url + "_[TEXT]_" + b.content + "_[YLMF]_",
                    d = Cookie.get("history");
                    d && (d.indexOf(c) > -1 && (d = d.replace(c, "")), c += d);
                    Cookie.set("history", c, null, null, "114la.com");
                    var e;
                    document.getElementById("bb1") && (e = document.getElementById("bb1").getElementsByTagName("iframe"));
                    e && e.length && e[0].contentWindow.History.show()
                }
            } catch(f) {}
        }
    }
} (),
miniSearch = function() {
    function a() {
        KeywordCount({
            type: b,
            word: c.value,
            url: window.location.href,
            key: cache.is("CLICK_BS_BTN") ? "B": 13
        },
        "http://www.tjj.com/click.php");
        cache.remove("CLICK_BS_BTN")
    }
    var b = "s0",
    c = $("#f_int input").el;
    $("#f_radio input.radio").each(function(a) {
        if (a.checked == !0) b = a.id;
        a.onclick = function() {
            b = this.id
        }
    });
    $("#f_btn input").on("click",
    function() {
        cache.set("CLICK_BS_BTN", 1)
    });
    return {
        gosearch: function(d) {
            if (b == "s0") a(),
            d.submit();
            else {
                var e;
                switch (b) {
                case "s2":
                    e = "www.google.com.hk/search?q=";
                    break;
                case "s3":
                    $("#taobao-q").el.value = c.value;
                    if (!cache.get("TAOBAO_PARM")) {
                        var d = Config.Search.taobao.params,
                        f;
                        for (f in d) $("#taobao-form").create("input", {
                            type: "hidden",
                            name: f,
                            value: d[f]
                        },
                        function(a) {
                            this.append(a)
                        });
                        cache.set("TAOBAO_PARM", !0)
                    }
                    a();
                    $("#taobao-form").el.submit();
                    return;
                case "s4":
                    window.open("http://www.caimincun.com");
                    return;
                case "s5":
                    window.open("http://www.soso.com/q?w=" + c.value + "&unc=s200000_8&cid=union.s.wh&ie=gb2312");
                    a();
                    return
                }
                window.open("http://" + e + encodeURIComponent(c.value));
                a()
            }
        }
    }
} ();
$("#tool-tab li").each(function(a) {
    HoverTab(a,
    function() {
        $("#tool-tab li").removeClass("active");
        a.className = "active";
        var b = a.getAttribute("rel");
        $(".tbox").hide();
        $("#" + b).show()
    })
});
Browser.isIE == "6.0" && ($("#tool-imp li").on("mouseover",
function(a) {
    $("#tool-imp li").removeClass("hover");
    $(a).addClass("hover")
}), $("#tool-imp li").on("mouseout",
function() {
    $("#tool-imp li").removeClass("hover")
}));
function KeywordCount(a, b) {
    if (a && a != "") {
        var c = b || "http://www.tjj.com/index",
        d = (new Date).getTime(),
        e = new Image,
        f = "",
        g;
        for (g in a) f += g == "u" ? "?" + g + "=" + encodeURIComponent(a[g]) : "&" + g + "=" + encodeURIComponent(a[g]);
        e.src = c == "http://www.tjj.com/index" ? c + f + "&i=" + d: c + "?i=" + d + f
    }
}
DOMReady(function() {
    if (Browser.isIE) $("#sf .int").el.value = "";
    $("#mail_user_114la,#mail_passwd_114la,#f_int input,#q_int input").on("mouseover",
    function(a) {
        cache.get(a.id + "GETFOCUS") && a.parentNode.id == "q_int" || (document.all ? Yl.getFocus(a) : a.focus())
    });
    $("#mail_user_114la,#mail_passwd_114la,#f_int input,#q_int input").on("blur",
    function(a) {
        cache.remove(a.id + "GETFOCUS")
    });
    $("#mail_user_114la,#mail_passwd_114la").on("focus",
    function(a) {
        cache.set(a.id + "GETFOCUS", !0)
    })
});
var kuxun = function() {
    return {
        searchTravel: function() {
            var a = document.getElementById("daodao_travel_q").value,
            b = document.getElementById("daodao_travel_k").value,
            c = "http://dujia.kuxun.cn/index.php?action=xianlu&method=bdsearchpost";
            a && !b ? c += "&StartPlace=" + encodeURIComponent(a) : !a && b ? c += "&KeyWords=" + encodeURIComponent(b) : a && b && (c += "&StartPlace=" + encodeURIComponent(a) + "&KeyWords=" + encodeURIComponent(b));
            c += "&SourceID=kuxunbd&FromID=K115wp-S1314061-T1183251";
            window.open(c)
        },
        searchHotel: function() {
            var a = document.getElementById("ht_city").value,
            b = document.getElementById("ht_key").value,
            c = document.getElementById("ht_today").value,
            d = "http://hotel.kuxun.cn/search.php";
            a && !b ? d += "?city=" + encodeURIComponent(a) : !a && b ? d += "?hotel=" + encodeURIComponent(b) : a && b && (d += "?city=" + encodeURIComponent(a) + "&hotel=" + encodeURIComponent(b));
            d += "&date=" + c + "&fromid=K115wp-S1314061-T1168071";
            window.open(d)
        }
    }
} ();
function goTop(a, b) {
    var a = a || 0.1,
    b = b || 15,
    c = 0,
    d = 0;
    document.documentElement && (c = document.documentElement.scrollLeft || 0, d = document.documentElement.scrollTop || 0);
    var e = 1 + a;
    window.scrollTo(Math.floor(c / e), Math.floor(d / e));
    (c > 0 || d > 0) && window.setTimeout("goTop(" + a + ", " + b + ")", b)
}
function ResumeError() {
    return ! 0
};